package com.hzzy.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hzzy.IDao.HzCommonMapper;
import com.hzzy.bean.HzDormitorRecord;
import com.hzzy.bean.HzStudent;
import com.hzzy.bean.HzTeacher;
import com.hzzy.service.HzCommonService;

/**
 * 各种公共方法
 * @author L
 *
 */
@Service
public class HzCommonServiceImp  implements HzCommonService{
	@Autowired
	private HzCommonMapper  hzCommonMapper;
	/**
	 * 更具班级id查询老师列表
	 * @param param
	 * @return
	 */
	public List<HzTeacher> queryTeachersByClassid(Map<String, List<Object>> param) {
		
		return hzCommonMapper.queryTeachersByClassid(param);
	}
	/**
	 * 寝室管理员查看自己管理下的寝室学生考勤列表
	 * 
	 */
	public List<HzDormitorRecord> querydormmembersByDTeacherid(Map<String, Object> param) {
		
		return hzCommonMapper.querydormmembersByDTeacherid(param);
	}
	/**
	 * 班主任查看自己管理下的寝室学生考勤列表
	 */
	public List<HzDormitorRecord> querydormmembersByCTeacherid(Map<String, Object> param) {
		
		return hzCommonMapper.querydormmembersByCTeacherid(param);
	}
	/**
	 * 通过学生id查询学生联系人
	 */
	public HzStudent queryStudentByStudentid(Map<String, Object> param) {
		return hzCommonMapper.queryStudentByStudentid(param);
	}
	
	/**
	 * 查询班级点到概述(天)
	 */
	public int queryClassDormCheckinDay(String classid, String data, int dcstate) {
		Map<String, Object> param  = new HashMap<String, Object>();
		param.put("classid", classid);
		param.put("data", data);
		param.put("dcstate",dcstate);
		return hzCommonMapper.queryClassDormCheckinDay(param);
	}
	/**
	 * 查询班级点到概述(年)
	 */
	public int queryClassDormCheckinYear(String classid, String startdata, String enddata, int dcstate) {
		Map<String, Object> param  = new HashMap<String, Object>();
		param.put("classid", classid);
		param.put("startdate", startdata);
		param.put("enddate", enddata);
		param.put("dcstate",dcstate);
		return hzCommonMapper.queryClassDormCheckinYear(param);
	}
	/**
	 * 查询班级人数
	 */
	public int queryClassMemberSize(String classid) {
		Map<String, Object> param  = new HashMap<String, Object>();
		param.put("classid", classid);
		return hzCommonMapper.queryClassMemberSize(param);
	}
	public List<HzDormitorRecord> queryClassCheckinbycid(String classid, String startdata, String enddata) {
		Map<String, Object> param  = new HashMap<String, Object>();
		param.put("classid", classid);
		param.put("startdate", startdata);
		param.put("enddata", enddata);
		return hzCommonMapper.queryClassCheckinbycid(param);
	}
	
	
}
